var orderCache = require('../../../utils/mr_xu/apply_order_cache.js')
var common = require('../../../utils/mr_xu/common.js')

Page({

  /**
   * 页面的初始数据
   */
  data: {
    remark: '',
    carImageList: [],
    business:''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {

    this.setData({
      business: business
    })
    
    let that = this
    let updateInfo = orderCache.getUpdateInfo()
    if (updateInfo) {
      that.setData({
        remark: updateInfo.clue,
        carImageList: updateInfo.clueImageLst ? updateInfo.clueImageLst : []
      })
    }
  },

  edit_remark: function(res) {
    this.setData({
      remark: res.detail.value
    })
  },
  next: function() {
    let that = this
    common.safeRun(function() {
      orderCache.setItem('clue', that.data.remark)
      orderCache.setItem('clueImageLst', that.data.carImageList)

      wx.navigateTo({
        url: '../step6_commission/commission',
      })
    })
  },
  imagesChange(e) {

    let images = e.detail
    this.setData({
      carImageList: images
    })

  },
})